<template>
	<!-- 填充 -->
	<view class="taskBody">
		<view class="item" v-for="(item,index) in taskList" :key="index"
			@click="$util.redirectTo('/pages/taskdetails/taskdetails',{id:item.id})">
			<view class="box">
				<image :src="$util.img(item.file)" mode="aspectFill"></image>
				<view class="right">
					<view class="r-left">
						<view class="top">{{item.name}}</view>
						<view class="box-bottom">
							<text class="money">￥{{item.price}}元</text>
							<view class="tips">
								<text class="iconfont icon-qian"></text>
								<text>剩余{{item.surplus}}</text>
							</view>
						</view>
					</view>
					<view class="r-right">
						<view class="zd" v-if="item.zdstatus">置顶</view>
						<view class="btn">马上赚</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			// 展示方式切换
			taskSwitch:{
				type:Boolean,
				default:false
			},
			//数据
			taskList:{
				type:Array,
				default(){
					return []
				}
			}
		},
		data(){
			return {
				zpid:{}
			}
		},
		mounted(){
			this.zpid = uni.getStorageSync('zpid');
		},
		methods:{
		}
	}
</script>

<style lang="scss" scoped>
	.taskBody{
		margin-top: 20rpx;
		.item{
			padding: 28rpx 20rpx 20rpx;
			box-sizing: border-box;
			background: #FFFFFF;
			border-radius: 10px;
			box-shadow: 0px 2px 6px 0px rgba(225, 225, 225, 40);
			margin:0 30rpx 20rpx;
			.box{
				display: flex;
				align-items: center;
				image{
					width: 80rpx;
					height: 80rpx;
					border-radius: 50%;
					margin-right: 30rpx;
				}
				.right{
					display: flex;
					align-items: center;
					justify-content: space-between;
					width: calc(100% - 80rpx - 30rpx);
					.r-left{
						.top{
							width: 350rpx;
							font-size: 26rpx;
							color: #101010;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
						}
						.box-bottom{
							display: flex;
							align-items: center;
							margin-top: 10rpx;
							.money{
								color: $uni-tabbar-hovercolor;
								font-size: 28rpx;
								margin-right: 30rpx;
							}
							.tips {
								color: #999999;
								// font-weight: bold;
								font-size: 24rpx;
								display: flex;
								align-items: center;
								.iconfont {
									margin-right: 16rpx;
								}
							}
						}

					}
					.r-right{
						.zd{
							margin:0 10rpx 10rpx 0;
							padding: 5rpx 10rpx;
							border-radius: 10rpx;
							font-size: 12px;
							background: #FF6F30;
							color: #fff;
							display: inline-block;
							float: right;
						}
						.btn{
							float: right;
							width: 140rpx;
							line-height: 40rpx;
							border-radius: 34rpx;
							font-size: 24rpx;
							color: #FFFFFF;
							margin-bottom: 10rpx;
							background: #FF6F30;
							padding: 4rpx 8rpx;
							text-align: center;
						}
						
					}
				}
			}
		}
	}
</style>
